package cn.zifangsky.designpattern.singleton;

/**
 * 单例模式第三种实现
 *
 * @author zifangsky
 * @date 2020/5/19
 * @since 1.0.0
 */
public class Singleton3 {
    private static Singleton3 SINGLETON;

    private Singleton3(){

    }

    public static synchronized Singleton3 getInstance(){
        if(SINGLETON == null){
            SINGLETON = new Singleton3();
        }

        return SINGLETON;
    }
}
